import Vue from 'vue'
const log = {
  // 获取附带状态的任务列表
  getList: function getList(ip, postdata) {
    var ipPath = ip + '/' + postdata.name + '/' + postdata.pageNumber + '/' + postdata.pageSize
    return Vue.http.post(ip, postdata).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  },
  getNameList: function getNameList(ip, postdata) {
    return Vue.http.get(ip, {}).then(response => {
      if (response.status === 200) {
        return Promise.resolve(response.body)
      } else {
        return Promise.reject(response.data.message)
      }
    })
  }
}

export default log
